
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_wan_android/widgets/home_widgets.dart';

class NetworkImage extends StatelessWidget{

  final String imageUrl;
  final BoxFit fit;
  final double width;
  final double height;


  const NetworkImage( this.imageUrl,{Key key, this.fit, this.width, this.height}) : super(key: key);


  @override
  Widget build(BuildContext context) {

    return CachedNetworkImage(
      fit: BoxFit.fill,
      imageUrl: imageUrl,
      width: width==0?72.0:width,
      height: height==0?128.00:height,
      placeholder: (context, url) => ProgressView(),
      errorWidget: (context, url,object) =>  Icon(Icons.error),);
  }

}